<template>
  <el-card>
    <el-form>
      <el-row>
        <el-col :span="3">
          <el-form-item>
            <el-button type="text">上一题</el-button>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item>
            <span>1.在磁盘调度管理中，应先进行移臂调度，再进行旋转调度。假设磁盘移动臂位于 21 号柱面
              上，进程的请求序列如下表所示。如果采用最短移臂调度算法，那么系统的响应序列应为
              （ ）。
            </span>
          </el-form-item>
        </el-col>
        <el-col :span="3">
          <el-form-item>
            <el-button type="text">下一题</el-button>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="3">
        </el-col>
        <el-col :span="12">
          <el-form-item>
            <el-radio-group
              ref="radio1"
              v-model="radio1"
              size="small"
              @change="handleChangeRadio"
            >
              <div
                v-for="item in entity.items"
                :key="item"
                class="text item"
              >

                <el-radio
                  :label="item.num"
                  border
                >{{ item.num}}.{{ item.content}}</el-radio>
              </div>
            </el-radio-group>
          </el-form-item>
        </el-col>

      </el-row>

    </el-form>
  </el-card>
</template>

<script>
import * as PaperApi from '@/api/base/paper'
import axios from 'axios'

export default {
  name: 'paper',
  data() {
    return {
      radio1: '1',
      url: '',
      entity: {
        items: [
          { num: 'A', content: '11' },
          { num: 'B', content: '22' },
          { num: 'C', content: '33' },
          { num: 'D', content: '44' }
        ]
      }
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      const actionUrl = this.HOST + '/base/answer-base-paper/' + 'initEditPage'
      axios({
        url: actionUrl,
        method: 'post',
        params: { id: 1 }
      }).then(response => {
        console.log('response')
        console.log(response)
      })
    },
    handleChangeRadio(data) {
      // debugger
      if (data) {
        this.$refs.radio1.disabled = true
        // 获取答案
        // api.getAnswerItem(id)
        // 判断对错
      }
    },
    getNext() {
      const actionUrl = this.HOST + '/base/answer-base-paper-item' + 'initEditPage'
      axios({
        url: actionUrl,
        method: 'post',
        params: { id: 1 }
      }).then(response => {
        console.log('response')
        console.log(response)
      })
    },
    getPre() {
      const actionUrl = this.HOST + '/base/answer-base-paper-item' + 'initEditPage'
      axios({
        url: actionUrl,
        method: 'post',
        params: { id: 1 }
      }).then(response => {
        console.log('response')
        console.log(response)
      })
    }
  }
}
</script>
